<page-header [title]="'店铺管理'">
  设置店铺名称、logo、简介、店主联系方、运费、退换货规则等...
</page-header>
<h3>店铺信息</h3>
<nz-card [nzBordered]="false">
  <form
    nz-form
    [formGroup]="form"
    (ngSubmit)="submit()"
    se-container="1"
    labelWidth="200"
  >
    <se label="名称" error="请输入名称" required>
      <input nz-input formControlName="shopName" placeholder="给店铺起个名字" />
    </se>
    <se label="介绍" error="请输入目标描述" required>
      <textarea
        nz-input
        formControlName="brandIntroduction"
        [nzAutosize]="{ minRows: 4 }"
        placeholder="请输入店铺描述"
      ></textarea>
    </se>
    <se label="电话" error="请输入店主电话" required>
      <input nz-input formControlName="telephone" placeholder="联系电话" />
    </se>
    <se label="地址" error="请输入店铺地址" required>
      <input nz-input formControlName="shopAddress" placeholder="店铺地址" />
    </se>
    <se label="logo" error="请上传店铺logo" required>
      <div class="clearfix">
        <nz-upload
          nzAction="https://xcx.ruiysoft.com/reserve/qiniu/upload"
          [nzCustomRequest]="customReq"
          nzListType="picture-card"
          [(nzFileList)]="fileList"
          [nzShowButton]="fileList.length < 1"
          [nzPreview]="handlePreview"
        >
          <i nz-icon type="plus"></i>
          <div class="ant-upload-text">上传</div>
        </nz-upload>
        <nz-modal
          [nzVisible]="previewVisible"
          [nzContent]="modalContent"
          [nzFooter]="null"
          (nzOnCancel)="previewVisible = false"
        >
          <ng-template #modalContent>
            <img [src]="previewImage" [ngStyle]="{ width: '100%' }" />
          </ng-template>
        </nz-modal>
      </div>
    </se>

    <se>
      <button nz-button nzType="primary" type="submit" [nzLoading]="submitting">
        更新
      </button>
    </se>
  </form>
</nz-card>

<h3>运费</h3>
<nz-card [nzBordered]="false">
  <form
    nz-form
    [formGroup]="form3"
    (ngSubmit)="submit3()"
    se-container="1"
    labelWidth="200"
  >
    <se label="运费" error="" required>
      <input nz-input formControlName="fee" placeholder="" />
    </se>
    <se label="满多少免运费" error="" required>
      <input nz-input formControlName="fullFee" placeholder="" />
    </se>
    <se label="运费说明" error="">
      <textarea
        nz-input
        formControlName="info"
        [nzAutosize]="{ minRows: 4 }"
        placeholder=""
      ></textarea>
    </se>
    <se>
      <button nz-button nzType="primary" type="submit" [nzLoading]="submitting">
        更新
      </button>
    </se>
  </form>
</nz-card>

<h3>退换货规则</h3>
<nz-card [nzBordered]="false">
  <button nz-button (click)="add(modalContent2)" [nzType]="'primary'">
    <i nz-icon type="plus"></i> <span>新建</span>
  </button>
  <nz-divider></nz-divider>
  <st
    #st
    [columns]="columns"
    [data]="data"
    [loading]="loading"
    (change)="stChange($event)"
  >
    <ng-template st-row="status" let-i>
      <nz-badge [nzStatus]="i.statusType" [nzText]="i.statusText"></nz-badge>
    </ng-template>
  </st>
</nz-card>

<ng-template #modalContent2>
  <form
    nz-form
    [formGroup]="form2"
    (ngSubmit)="submit2()"
    se-container="1"
    labelWidth="200"
  >
    <se label="最多几天换货" error="" required>
      <input nz-input formControlName="returnedDay" placeholder="" />
    </se>
    <se label="最多几天退货" error="" required>
      <input nz-input formControlName="exchangeDay" placeholder="" />
    </se>
    <se label="是否全店默认" error="" required>
      <nz-switch
        nzCheckedChildren="是"
        nzUnCheckedChildren="否"
        nz-input
        formControlName="isDefault"
      ></nz-switch>
    </se>
  </form>
</ng-template>

<h3>积分</h3>
<nz-card [nzBordered]="false">
  <form
    nz-form
    [formGroup]="form4"
    (ngSubmit)="submit4()"
    se-container="1"
    labelWidth="200"
  >
    <se label="积分对人民币汇率" error="" required>
      <input nz-input formControlName="fee" placeholder="" />
    </se>
    <se>
      <button nz-button nzType="primary" type="submit" [nzLoading]="submitting">
        更新
      </button>
    </se>
  </form>
</nz-card>
